using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Collections;
using System.Configuration;

/// <summary>
/// Summary description for SqlDataProvider
/// </summary>
public class SqlDataProvider
{
    private string conString;
    private SqlConnection con;
	
    public SqlDataProvider()
	{
        this.conString = ConfigurationManager.ConnectionStrings["TransportConnectionString"].ConnectionString;
	}

    //Properties.
    public String ConnectionString
    {
        set { this.conString = value; }
    }
    public SqlConnection SQLConnection
    {
        set { this.con = value; }
        get { return this.con; }
    }

    //Methods.
    public void MoKetNoi()
    {
        try
        {
            this.con = new SqlConnection();
            this.con.ConnectionString = this.conString;
            this.con.Open();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }

    public void DongKetNoi()
    {
        try
        {
            this.con.Close();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }

}
